# Maintainer: David Runge <dvzrv@archlinux.org>

pkgname=irker
pkgver=2.23
pkgrel=1
pkgdesc="An IRC client that runs as a daemon accepting notification requests"
arch=(any)
url="https://gitlab.com/esr/irker"
license=(BSD)
depends=(python python-pysocks)
makedepends=(docbook-xml docbook-xsl xmlto)
optdepends=('python-simplejson: alternative JSON backend for irkerhook.py')
backup=(etc/$pkgname/irkerd.env)
source=(
  https://gitlab.com/esr/$pkgname/-/archive/$pkgver/$pkgname-$pkgver.tar.gz
  irkerd.service
  irkerd.env
  irker.sysusers
  irker.tmpfiles
)
sha512sums=('953be35269c6f8f6ab056e97fa73fe4b2fd1e5b7784bbbc8d1b371a6b8b302dcae422b56762a94b530e064e5fa2f4d4e3985d9f5db8cafcd1025570f9c7a63e7'
            'f6a5c291258e0c341e3a5ba5fa2f6a43013be5c8faa5a372188854876cfe7f0dcd0bd979fa5627388216957103bfe1d002aefb74d51a620d05c16be87b639821'
            '734b98a72073f9b8168b141a4ebd2819eb5173a7e56b3ff3e843edc1db1107249764dcb4e3b5d95860e6d119d7b4abb8bfbe8b8a9c1398011d19dfd6dacd9d2d'
            '957a40e603783170fca8a4a4983cfdffa9b92918eb413b436341235685d59a1f05c49befa57239c0f5d5f72655b91b6f0dbe3cec07278f61c0e1ae9d7460e199'
            '5eb944a3f18dd23321d7ef31f0079c55be9af4f82e981a9071f21080e1bfbcb428ed6245dad8095ac2e3118d964d9b26b73d6786b8141354182b1b9cc3dcee2d')
b2sums=('dca99255da5efc89ff41b74bca580dfd0159062da501941766e7011f2b58f4b7fbe8a3f252f0e3fcac949b12aca1cd52dec6d9fb0a06e1f431b39da22e83fa6f'
        '8f239dd9f03e7377572fb2f2f8a77004ddcf1ed423d93965b689296758214aa5e1913ff87bc889456f7ea248ee0a7d8edd18cbc8890814ef2b54c79b126eb80b'
        '7196806c47ba34a89aed6c27657767f444fdf5dd21ae309d5ab1617ee4f75f7f35f0fc7bb205cb339367e083debe74f54ddfb1c633d32d2106aa02e312cfbe0d'
        'e7bd8d0599588ab86650abc3ad731c106c4f0ac8afcc9963e343d18126589fe185438e4590c7dc93cbe5f60a40123100766145b9db6d73895853ebd9a3b66724'
        '91eb92bbf64ba92b461a637df8ed84a978950f439e4161b7a3a7486e87a64a0156790b11c621f4770adbdac33f82b2b284a9ac44222dc2140c162247c4164cb0')

build() {
  make -C $pkgname-$pkgver
}

package() {
  make DESTDIR="$pkgdir/" install -C $pkgname-$pkgver
  install -vDm 755 $pkgname-$pkgver/{irk,irkerhook.py} -t "$pkgdir/usr/bin"
  install -vDm 644 $pkgname-$pkgver/COPYING -t "$pkgdir/usr/share/licenses/$pkgname"
  install -vDm 644 $pkgname-$pkgver/{NEWS,README,{hacking,security}.adoc} -t "$pkgdir/usr/share/doc/$pkgname/"
  install -vDm 644 irkerd.service -t "$pkgdir/usr/lib/systemd/system/"
  install -vDm 640 irkerd.env -t "$pkgdir/etc/$pkgname/"
  install -vDm 644 irker.sysusers "$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
  install -vDm 644 irker.tmpfiles "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
}
